#include "SDL.h"
#include "engine.h"
#include "world.h"
#include "globals.h"
#include "menu.h"

#include <cstdio>

world *current_world;

int main(){
	
	engine::init(800, 600, 32);

	current_world = menu::make_menu();

	SDL_Rect menuscreen;
	menuscreen.w = 400;
	menuscreen.h = 600;
	menuscreen.x = 100; 
	menuscreen.y = 0;

	//take care of events
	SDL_Event event;
	//main loop
	while(1){
		//event
		while(SDL_PollEvent(&event)){
			if(event.type == SDL_QUIT){
				exit(0);
			}
			else{
				current_world->react(event);
			}
		}
		//time
		
		//draw current world onto the screen
		current_world->draw(engine::screen, &menuscreen);

		//swap screen buffers
		engine::swap();
	}


	SDL_Quit();
return 0;
}
